<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<body>
<ui:composition template="/templates/template.xhtml">
    <ui:define name="body">
        <h:form id="uploadForm">
            <h:panelGrid columns="1">
                <h:panelGroup rendered="#{foruploadpagebean.uploaded==false}" id="panelloadfile">
                    <rich:fileUpload fileUploadListener="#{foruploadpagebean.fileUploadListener}" allowFlash="true"
                                     acceptedTypes="xml,ini,properties"
                                     ontyperejected="alert('Only JPG, GIF, PNG and BMP files are accepted');">
                        <a4j:ajax event="uploadcomplete" render="legal"/>
                    </rich:fileUpload>
                </h:panelGroup>
                <h:commandLink action="#{foruploadpagebean.clearAndGoEmptyPage}"
                               rendered="#{foruploadpagebean.uploaded==false}" render="legal">
                    <h:outputText value="#{uploadpage.cancelupload}"/>
                </h:commandLink>
                <h:panelGroup id="panelchoseprotocol" rendered="#{foruploadpagebean.uploaded==true}">
                    <h:panelGrid columns="1">
                        <h:commandButton value="#{uploadpage.dropupload}" action="#{foruploadpagebean.clearAndGoEmptyPage}"
                                         render="legal"/>
                        <h:outputText value="#{foruploadpagebean.oldFileName}"/>
                        <h:outputText value="#{uploadpage.choseformat}"/>
                        <h:selectOneListbox value="#{foruploadpagebean.protocol}">
                            <f:selectItem itemValue="ini" itemLabel="ini"/>
                            <f:selectItem itemValue="xml" itemLabel="xml"/>
                            <f:selectItem itemValue="props" itemLabel="properties"/>
                        </h:selectOneListbox>
                        <h:commandButton value="#{uploadpage.actiongiveconfig}" action="#{foruploadpagebean.goPresentPage}"
                                         render="legal,presentationform"/>
                    </h:panelGrid>
                </h:panelGroup>
            </h:panelGrid>
        </h:form>
    </ui:define>
</ui:composition>
</body>
</html>